﻿/**
 * @Description 基础框架服务调用实例-报表服务
 *@Author  guoyanfei
 */

var serviceUrl = '/gdp'
var commServices = commServices || {};
commServices.prototype = {
    init: function () {//初始化
        $("#repIframe").attr("src", serviceUrl + "/business/singleReportServer/singleReportShow?guid=" + serviceId);
    }
};

//服务初始化
$(function () {
    $("#sp_seviceUrl").append("服务地址：" + serviceUrl + "/business/singleReportServer/singleReportShow");
    $("#sp_seviceUrl").append("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;服务ID：" + serviceId);

    var comm = commServices.prototype;
    comm.init();
    setIframeHeight();
})

//iframe高度自适应
function setIframeHeight() {
    iframe = document.getElementById('repIframe');
    if (iframe) {
        var iframeWin = iframe.contentWindow || iframe.contentDocument.parentWindow;
        if (iframeWin.document.body) {
            var strheight = document.documentElement.clientHeight - 170;
            iframe.height = strheight;
        }
    }
};
